package day05;

public class Test05 {
    public static void main(String[] args) {
        System.out.println("Hello Test05!");
        int[] array = { 1, 2, 3, 4, 5 };
        double avg = getAvg(array);
        System.out.println("该位置的平均数是：" + avg);
    }

    public static double getAvg(int[] arr) {
        double avg = 0.0;
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        int num = arr.length;
        avg = sum / num;
        return avg;
    }
}
